﻿using HlElock.Api;
using HlELock.Page.ViewModels;
using System;
using System.Net.Http;
using System.Windows;

namespace HlELock.Page.Views
{
    public partial class DoorLockWindow : Window
    {
        public DoorLockWindow()
        {
            InitializeComponent();

            // 创建 HttpClient 实例
            var httpClient = new HttpClient();
            // 设置基础地址（如果需要）
            httpClient.BaseAddress = new Uri("http://pms.njxly.xyz/tp/public/");

            // 创建 API 客户端
            var apiClient = new RoomApiClient(httpClient);

            // 创建 ViewModel 并设置为 DataContext
            var viewModel = new DoorLockWindowViewModel(apiClient);
            DataContext = viewModel;

        }
    }
}